fi => excludeItemFileInfo.
authorCamila Ayres <hello@camilasan.com>
Tue, 18 Feb 2025 14:52:11 +0000 (15:52 +0100)
committerJyrki Gadinger <nilsding@nilsding.org>
Wed, 19 Feb 2025 07:52:54 +0000 (08:52 +0100)
Signed-off-by: Camila Ayres <hello@camilasan.com>
src/gui/folder.cpp

index 12ceca25accba7752c9b4a3d8d063e425cb7d651..d9aaeafaeee3ab5aa5db5be09cccc0a4eae3bd9b 100644 (file)
@@ -1530,7 +1530,6 @@ void Folder::warnOnNewExcludedItem(const SyncJournalFileRecord &record, const QS
     // for folders only on creation and deletion - if we got a notification
     // on content change that would create spurious warnings.
     const auto fullPath = QString{_canonicalLocalPath + path};
-    QFileInfo fi(fullPath);
     if (!FileSystem::fileExists(fullPath)) {
         return;
     }
@@ -1544,13 +1543,15 @@ void Folder::warnOnNewExcludedItem(const SyncJournalFileRecord &record, const QS
         return;
     }
 
+    QFileInfo excludeItemFileInfo(fullPath);
+    const auto excludeItemFilePath = excludeItemFileInfo.filePath();
     const auto message = FileSystem::isDir(fullPath)
         ? tr("The folder %1 was created but was excluded from synchronization previously. "
              "Data inside it will not be synchronized.")
-              .arg(fi.filePath())
+              .arg(excludeItemFilePath)
         : tr("The file %1 was created but was excluded from synchronization previously. "
              "It will not be synchronized.")
-              .arg(fi.filePath());
+              .arg(excludeItemFilePath);
 
     Logger::instance()->postGuiLog(Theme::instance()->appNameGUI(), message);
 }